from pysvn import Repository, Client

# 创建 SVN 仓库实例
repo_url = "http://your_svn_repo_url"
repos = Repository(repo_url)

# 使用客户端连接到仓库
client = Client()

# 检索工作目录的信息
working_copy_path = '/path/to/your/local/workcopy'
info = client.info(working_copy_path)

# 打印工作目录的根节点信息
root_node = info['entry'].node
print(f"Root node URL: {root_node.url}")

# 示例性地提交更改（实际操作时需替换 commit_message 和 file_path）
commit_message = "Initial commit with PySVN"
file_path = 'file_to_commit.txt'

# 获取文件修订
file_info = repos.get_file_info(file_path)
revision = file_info.revision.number

# 提交更改
client.commit(working_copy_path, commit_message, revision+1, add=True, delete=False)

# 关闭连接
client.close()